|
![](/i/fill.gif) |
In article <3a8c3198$1@news.povray.org> , "KalleK" <kal### [at] gmx de>
wrote:
> Do I have to compare every component seperated?
Yes, you do. There is no general way to compare a vector to a scalar.
Imagine <10,100,-20> == y , what would the result be? Clearly the
second component is dominating, or should it only evaluate to true for
<0,1,0> == y ? And what about <4,8,2> == <2,4,1> ? The direction is
the same, yet the first one is twice as long as the second one.
> Or what's the error?
The documentation makes is clear that there are no comparisons of
vectors supported (section "Vector Operators"), not even those for
equality.
> #local T0 = x;
> #local T1 = 1;
> #local T1 = (T0=y);
> This driggers the error : "Attempted to redefine float identifier as vector
> identifier." but a
> conditions should be represented as a boolean/float.
Keep in mind that x, y and z have a special meaning. y is the vector
<0,1,0>, not a scalar. And as you know from the documentation, there
are no comparison operators for vectors. Since the parser assumes this
it will stop at the first vector (T0) it finds and not even see the
comparison operator that is following it. However, I have to admit that
the error message is a bit confusing :-(
Thorsten
Post a reply to this message
|
![](/i/fill.gif) |